import java.util.PriorityQueue;

public class Test {
    public static void main(String[] args) {
        int[] arr = new int[]{100, 4, 200, 1, 3, 2};
        if(arr.length == 1) {
            System.out.println(1);
        }
        PriorityQueue<Integer> heap = new PriorityQueue<>((v1, v2) -> v1 - v2);
        for(int x : arr){
            heap.add(x);
        }
        for(int i = 0; i < arr.length; i++){
            arr[i] = heap.poll();
        }
        int i = 0, j = 1, count = 1;
        while(j < arr.length){
            if(arr[j] - arr[i] == 1){
                count++;
            }else{
                count = 1;
            }
            i++;
            j++;
        }
        System.out.println(count);
    }
}
